$OpenBSD: patch-pjlib_src_pj_guid_uuid_c,v 1.1 2015/10/09 21:28:13 sthen Exp $
--- pjlib/src/pj/guid_uuid.c.orig	Thu May  5 07:14:19 2011
+++ pjlib/src/pj/guid_uuid.c	Fri Feb 20 20:18:33 2015
@@ -23,7 +23,11 @@
 #include <pj/os.h>
 #include <pj/string.h>
 
+#ifdef HAVE_UUID_CREATE
+#include <uuid.h>
+#else
 #include <uuid/uuid.h>
+#endif
 
 PJ_DEF_DATA(const unsigned) PJ_GUID_STRING_LENGTH=36;
 
@@ -35,6 +39,22 @@ PJ_DEF(unsigned) pj_GUID_STRING_LENGTH()
 PJ_DEF(pj_str_t*) pj_generate_unique_string(pj_str_t *str)
 {
     enum {GUID_LEN = 36};
+#ifdef HAVE_UUID_CREATE
+    char *sguid;
+    uuid_t uuid;
+    uint32_t status;
+
+    PJ_ASSERT_RETURN(GUID_LEN <= PJ_GUID_STRING_LENGTH, NULL);
+    PJ_ASSERT_RETURN(str->ptr != NULL, NULL);
+    PJ_CHECK_STACK();
+
+    uuid_create(&uuid, &status);
+    uuid_to_string(&uuid, &sguid, &status);
+
+    pj_memcpy(str->ptr, sguid, GUID_LEN);
+    str->slen = GUID_LEN;
+    free(sguid);
+#else
     char sguid[GUID_LEN + 1];
     uuid_t uuid = {0};
     
@@ -47,7 +67,7 @@ PJ_DEF(pj_str_t*) pj_generate_unique_string(pj_str_t *
     
     pj_memcpy(str->ptr, sguid, GUID_LEN);
     str->slen = GUID_LEN;
-
+#endif
     return str;
 }
 
